fix: prevent duplicate dock requests#1204
Merged
Merged
Conversation
1. Added check for existing docked applications in requestDockByDesktopId 2. Return false if application is already docked to avoid duplicate entries 3. Improves user experience by preventing redundant dock requests 4. Maintains cleaner taskbar state by avoiding duplicate icons fix: 防止重复的dock请求 1. 在requestDockByDesktopId中添加对已dock应用的检查 2. 如果应用已经dock则返回false避免重复条目 3. 通过防止冗余的dock请求提升用户体验 4. 避免重复图标保持任务栏状态更整洁 Pms: BUG-315721
Reviewer's GuideReworks requestDockByDesktopId to check for existing docked applications before docking, returning false to prevent duplicate entries and redundant taskbar icons. Sequence diagram for preventing duplicate dock requestssequenceDiagram
actor User
participant TaskManager
participant Taskbar
User->>TaskManager: requestDockByDesktopId(desktopID)
TaskManager->>TaskManager: desktopIdToAppId(desktopID)
TaskManager->>TaskManager: IsDocked(appId)?
alt Already docked
TaskManager-->>User: return false
else Not docked
TaskManager->>TaskManager: RequestDock(appId)
TaskManager-->>User: return result
end
Class diagram for TaskManager dock request logic updateclassDiagram
class TaskManager {
+bool requestDockByDesktopId(QString desktopID)
-QString desktopIdToAppId(QString desktopID)
-bool IsDocked(QString appId)
-bool RequestDock(QString appId)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review代码审查意见:
综合以上意见,代码可以修改如下: bool TaskManager::requestDockByDesktopId(const QString& desktop_id)
{
if (desktop_id.startsWith("internal/")) return false;
QString app_id = desktopIdToAppId(desktop_id);
// 检查应用是否已经在任务栏中,如果是则返回 false
if (IsDocked(app_id))
return false;
return RequestDock(app_id);
}以上修改提高了代码的可读性、可维护性和性能。 |
BLumia
approved these changes
Jul 25, 2025
18202781743
approved these changes
Jul 25, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: 防止重复的dock请求
Pms: BUG-315721
Summary by Sourcery
Prevent duplicate dock requests in TaskManager by adding a check for existing docked applications and returning false if already docked
Bug Fixes:
Enhancements: